<?php
/**
 * Created by PhpStorm.
 * User: dev
 * Date: 2018/8/7
 * Time: 10:46
 */

namespace App\Services\ApiServer\Response\Node;
use Illuminate\Support\Facades\Request;

/**
 * 节点调用基类
 * Class Demo
 */
class HomeNode
{
    /*
    * 节点
    */
    private $node;

    /*
    * 节点类
    */
    private $nodeClass;

    /**
     * 构造函数
     * CamNode constructor.
     */
    function __construct($category_name){
        switch(strtolower($category_name)){
            case 'eth':
                $nodeClass = new EthNode();
            break;
            case 'cam':
                $nodeClass = new CamNode();
            break;
        }
        $this->nodeClass = $nodeClass;
    }

    /**
     * 钱包地址余额
     * @DateTime 2018-08-13
     * @version  [version]
     * @param    {string}
     * @param    [type]     $address  [description]
     * @param    [type]     $asset_id [description]
     * @return   [type]               [description]
     */
    public function getWalletBalance($address, $asset_id = null){
        //调用方法返回结果
        $return = $this->nodeClass->getWalletBalance($address, $asset_id);
        return $return;
    }
}